home *** CD-ROM | disk | FTP | other *** search
/ Acorn User: China / Acorn User China CD-ROM (UK) (Disc A) / Acorn User China CD-ROM (UK) (Disc A).bin / DEMON / ACORN-STARTER / STARTERPACK.ARC / !SLIPdial_!Help < prev    next >
Encoding:
Text File  |  1995-04-09  |  31.2 KB  |  798 lines

  1. SLIPdial - a dialler for Archimedes !TCPIP               version 0.34
  2. ------------------------------------------
  3.  
  4. Slipdial is a script-driven dialler and general-control program for
  5. communications using !TCPIP. Its primary use is to initiate a connection
  6. with the network services provider (including dialling and logging-in)
  7. before handing over control to !TCPIP, and then to close down the connection
  8. cleanly when !TCPIP has finished. As well as the normal dialling and
  9. expect/send string functions for controlling your modem and negotiating a
  10. login, it also has many facilities to start and kill sub-tasks (both
  11. wimp-based and taskwindow-based); capturing and displaying messages from the
  12. remote computer; file handling; dialogue with the user; timer functions and
  13. more...
  14.  
  15. For example, you can define new icons to be added to the icon bar, which can
  16. have script-defined menus associated with them, as well as predefined
  17. actions for when the user clicks on them or drops a file on them.
  18.  
  19. Windows and controls
  20. --------------------
  21.  
  22. When slipdial starts, its icon appears on the icon bar. Clicking with SELECT
  23. on this icon opens the Status window, which tells you slipdial's state, and
  24. may allow selection of actions from a user-defined menu. Four icons down the
  25. right side of the window give access to a menu, perform a redial (if
  26. dialling), pause/unpause the script, or stop the script.
  27.  
  28. If no script is loaded, either as a default or by the startup switches you
  29. used (see later), you can load and start one by dropping its file on the
  30. iconbar icon or on the status window, or you can select one from the status
  31. window menu. Most of the time, however, a script will be run automatically.
  32.  
  33. Clicking on the slipdial icon with the ADJUST button opens the Control
  34. window. This window displays the script as it executes, incoming text from
  35. the serial port, and other status information. At the bottom of this window
  36. is an input field, which allows you to directly enter slipdial commands.
  37.  
  38. Two menus are available from the Control window. Pressing MENU gives you the
  39. choice of listing various items - the script itself; the currently-defined
  40. menus; variables, tasks and alarms. Pressing MENU while holding down the
  41. CTRL key lets you change the current "Debug level". This controls how much
  42. information about script execution is displayed in the Control window (see
  43. the entry on the "debug" command for more information on the exact effects).
  44.  
  45. The other window available from the slipdial icon - actually from its
  46. associated menu - is the "Choices" window. With this you can specify which
  47. windows to open, how large to make them, and whether to run a specified
  48. script automatically (you can drag a file to the writable field to set
  49. this). These choices can be saved as default actions for every time you run
  50. slipdial.
  51.  
  52. The Status Window
  53. -----------------
  54.  
  55. If you have trouble getting slipdial to communicate with your modem, the
  56. status window contains some diagnotic aids in the form of 3 "LED's", in the
  57. lower right-hand corner of the window. These show the state of some of the
  58. more important serial control lines - from left to right: DTR (data terminal
  59. ready); CTS and CD (carrier detect). Of these, probably only DTR and CD are
  60. of very much interest - DTR indicates that the serial line is active and the
  61. modem is in a condition to be talked-to; while CD indicates that the modem
  62. is online and has established communication with the remote modem.
  63.  
  64. Startup flags
  65. -------------
  66.  
  67. To override the auto-run option, hold down the ALT key while starting
  68. SLIPdial.
  69.  
  70. Command-line startup flags include:
  71.  
  72. -file <filename>
  73.  runs a specified script file on startup. Example:
  74.    run Slipdial:!Run -file SLIPdial:call_demon
  75.  
  76. -quiet
  77.  pevents status and control windows from being opened at startup.
  78.  
  79. -auto
  80.  autoruns the script Slipdial:default
  81.  
  82. -sprite <size>
  83.  specifies size of slipdial's internal sprite area, for addition of user icons.
  84.  
  85. All startup flags/switches can be abbreviated to 1 significant character. For
  86. example:
  87.   run slipdial:!Run -s 8000 -f Slipdial:call_demon
  88.  
  89. Script language
  90. ---------------
  91.  
  92. There's no consistancy to what's in the language; just whatever I thought
  93. might be useful. The language has evolved to be something like VMS DCL, in
  94. that commands are often modified by qualifiers (command/qualifier=value).
  95. It's even similar to DCL in its extreme lethargy of execution!
  96.  
  97. One useful point to know is that the first line of a script MUST be:
  98. #slipdial
  99.  
  100. and another is that that scriptfiles must have the "Text" filetype. The
  101. "#slipdial" comment at the start of the file prevents slipdial from
  102. attempting to load non-script textfiles.
  103.  
  104. Events
  105. ------
  106.  
  107. Certain commands set up actions with may occur asynchronously, meaning they
  108. don't follow the normal flow of the script. These could include timed
  109. alarms, user menu selections, line-condition alarms, etc. For the sake of
  110. giving these a name, I shall call these "events". Though they can be a
  111. little hard to understand at first (they can make it hard to understand the
  112. "flow" of your script), many of the most useful script capabilities center
  113. around them.
  114.  
  115. SLIPdial script syntax
  116. ----------------------
  117.  
  118. Many slipdial commands can take qualifiers, which alter their behaviour
  119. in some way. Command qualifiers are introduced with a slash (/) and may in
  120. some cases be followed by a value after an equals sign.
  121.  
  122. Parameters and qualifiers are generally space-delimited - if you wish to
  123. include spaces, the parameter or qualifier should be enclosed in quotation
  124. marks.
  125.  
  126. Multiple commands on a line are separated with the ";" character.
  127.  
  128. Commands may be continued across lines by using a trailing "-".
  129.  
  130. Characters with special meaning may be escaped with the "\" character to
  131. prevent their interpretation. Special characters include:
  132.  /      introduces qualifier
  133.  space  separates command components
  134.  "      encloses components to prevent splitting
  135.  ;      separates commands on a line
  136.  %      introduces script variable
  137.  \      the escape character itself
  138.  
  139. Remember to use extra escape characters in lines which may be expanded more
  140. than once. For example, the line:
  141.  alarm/icon=test "message \\%$file \\%$type"
  142. needs two escape characters to quote the variables, as they are expanded
  143. once upon setting the alarm, then again on alarm execution. Unfortunately,
  144. the number of escape characters needed in any relatively complex situation
  145. like this may not make sense. Where this proves to be a problem, the command
  146. may be preceded by the "literal" command to prevent any interpretation of
  147. special characters (such as % or \) in that command. This is particularly
  148. useful in setting variables for modem initialisation strings.
  149.  
  150. The values of script variables may be substituted into lines by prefixing
  151. them with a "%". For example, after the command "set test hello", the
  152. command "message %test" expands into "message hello".
  153.  
  154. The output of another command can also be substituted into a line. To do
  155. this, the command is enclosed in curly brackets {,}. The return value of the
  156. enclosed command will be substituted in its place. For example:
  157.  set test {?file slipdial:!run}
  158. expands to:
  159.  set test 1
  160. (assuming the file 'slipdial:!Run' has an object type of 1).
  161. Another example:
  162.  message {icon/free}
  163. displays the number of free bytes in the slipdial sprite area in a window.
  164.  
  165. Slipdial script commands
  166. ------------------------
  167. 1: General
  168. ----------
  169.  
  170. # comment
  171.  introduces a comment - the line is ignored (and, in fact, not loaded).
  172.  
  173. debug <n>
  174.  sets debugging level - controls what level of information is sent to the
  175.  control window and debug file (if any).
  176.    0 no debug output
  177.    1 script progress
  178.    2 text received from modem
  179.    3 log both text & script
  180.  
  181. echo [/status] [/date] <string>
  182.  echoes a string (or set of strings) to the control window (default)
  183.   or the status window.
  184.  /date adds the current date to the string before writing.
  185.  
  186. set <variable> <value> [<variable> <value> ... ]
  187.  assigns a value to a script variable. <value> should be quoted if it
  188.  includes spaces. More than one variable/value pair may be set at once.
  189.  
  190. unset <variable>
  191.  deassigns a script variable.
  192.  
  193. ?eq <variable> <variable|value>
  194. ?ne <variable> <variable|value>
  195. ?lt <variable> <variable|value>
  196. ?le <variable> <variable|value>
  197. ?gt <variable> <variable|value>
  198. ?ge <variable> <variable|value>
  199.  these test whether a variable is equal, unequal, greater, or less
  200.  than, another variable or value. Return 1 or 0 for true/false.
  201.  
  202. eval <expression>
  203.  returns result of mathematical operations (possibly on script variables).
  204.  eg: set lemming {eval "%lemming + 1"}
  205.    increments the value of 'lemming' by one.
  206.  
  207. string /size <string>
  208.  returns size (length) of a string.
  209. string /upper <string>
  210.  converts string to upper case
  211. string /lower <string>
  212.  converts string to lower case
  213. string /right=<n> <string>
  214.  returns rightmost <n> characters of string
  215. string /left=<n> <string>
  216.  returns leftmost <n> characters of string
  217. string /start=<n> /length=<n>
  218.  extracts a substring from a string
  219. string/instr=<string2> <string1>
  220.  returns position of <string2> in <string1>
  221.  
  222. oscli <os command> [<os command> ... ]
  223.  executes RISC OS commands. Return 1/0 for success/error.
  224.  
  225. osvar <variable>
  226.  returns value of OS variable
  227.  
  228. oseval <expression>
  229.  returns results of expression after evaluation by OS_EvaluateExpression.
  230.  Returned value can be a string or integer.
  231.  
  232. message [/id=<n>] [/add] [/title=<title>] [/capture[=<string>]] [/end=<string>]
  233.         [/max=<n>] [/wait] <line1> [<line2> ... ]
  234.  opens a window with a textual message for the user. Each line should be
  235.    enclosed in quotes.
  236.  /id=<n>  identifies which message window the command applies to. At
  237.           present there is only one window, and this qualifier is ignored.
  238.           The ability to specify multiple windows will be added in
  239.           later versions.
  240.  /wait    qualifier pauses script until user clicks on OK icon or closes
  241.           message window.
  242.  /capture[=<string>] will capture serial input to the message window, 
  243.           optionally starting from <string>. (See Notes at end)
  244.  /end=<string> causes message capture to end when <string> is found.
  245.  /max=<n> defines a maximum number of lines to capture.
  246.  /add     causes text to be added to an existing message. If no text
  247.           is given, the command simply forces an update (redraw) of the
  248.           message window.
  249.  
  250. message [/id=<id>] /close
  251.  explicitly closes any message window.
  252.  
  253. ask [/delay=<n>] [/default=<yes|no>] <question>
  254.  brings up a window asking for a yes/no answer from the user. Returns 1
  255.  if 'yes' is clicked; 0 if 'no' is clicked.
  256.  /delay=<n>     sets timeout (in seconds). If no response is received
  257.                 within this time, the default answer is returned.
  258.  /default=<y|n> sets the default answer returned if the command times
  259.                 out. If unspecified, 'no' (0) is assumed. Note that, at
  260.                 present, the default answer is not highlighted in any
  261.                 way on the dialogue window.
  262.  
  263. ?task <taskname>
  264.  returns task handle of task, or zero if it is not running.
  265.  
  266. error <message>
  267.  stops the script with an error message (and invokes error handler, if any
  268.  is installed.
  269.  
  270. help [<command>]
  271.  gives online help about script commands. "help" by itself gives a list
  272.  of available help topics.
  273.  
  274. newsrate <abbr>
  275.  computes the transfer rate of news from the time difference between
  276.  the xxxNews and xxxNG files, eg: newsrate Dem
  277.  Returns a value in characters per second.
  278.  
  279. literal
  280.  prevents variable substitution in the next following command. Useful for
  281.  such things as setting variable strings containing special characters such
  282.  as % or \.
  283.  
  284. 2: Script Flow
  285. --------------
  286.  
  287. :<label>
  288.  marks a label in the script; a destination for 'goto' or 'call'. Spaces
  289.  should not be used in a label definition.
  290.  
  291. goto <label>
  292.  transfers execution to the line following the given label.
  293.  
  294. call [/lock] <label> [<parameters>]
  295.  calls a subroutine, with optional parameters. The parameters are
  296.  placed into the script variables p1,p2,...,pn within the subroutine.
  297.  The /lock flag sets a 'lock flag' on the subroutine, which prevents it
  298.  from being re-entered until it has returned.
  299.  
  300. return [<value>]
  301.  return from subroutine, optionally passing back a return value. The returned
  302.  value may be numeric or textual.
  303.  
  304. if (<command>) <command>
  305.  conditionally executes a command depending on the status returned from
  306.  another command. For example:
  307.  if (?file $.lemming) exit
  308.   exits the script if the file $.lemming exists. You can also negate the test:
  309.   if (!?file $.lemming) exit
  310.  
  311. case <value|variable>
  312.  starts a case...when...endcase structure.
  313.  
  314. when <value> [<value> ... ] ; <commands>
  315.  executes the remainder of the line if one of values matches the current
  316.   "case" value. Note this only acts on the rest of the same line containing
  317.   the "when" statement.
  318.  
  319. endcase
  320.  marks the end of a case...when...endcase structure.
  321.  
  322. library <filename> [<parameters> ... ]
  323.  appends a script file to the current script for use as a library. If the
  324.  new file contains a subroutine "autoexec", it will be executed after
  325.  loading, being passed the parameters given in the library command.
  326.  
  327. source <filename>
  328.  directly executes script commands from the given file.
  329.  
  330. chain <filename>
  331.  loads and runs a new script. All variable (except for 'system' variables,
  332.  beginning with "$"), alarms, menus, etc are cleared. The name of the
  333.  original script is placed in the system variable "$caller".
  334.  
  335. exit
  336.  stops the script.
  337.  
  338. quit
  339.  stops the script and quit the program.
  340.  
  341. stop
  342.  simulates pressing the 'stop' button.
  343.  
  344.  
  345. 3: Serial i/o
  346. -------------
  347.  
  348. driver [<name>]
  349.  loads a modem driver, or sets the default (internal) driver if unspecified.
  350.  Modem drivers define the strings used to control the modem, and the status
  351.  messages returned from them.
  352.  
  353. port <driver> <port number>
  354.  loads the specified block driver, and use specified port number. For
  355.  example:
  356.   port sp_dual 1
  357.  If not specified, "port internal 0" is assumed.
  358.  
  359. speed <baud>
  360.  sets baud rate to <baud>. Default is 19200.
  361.  
  362. claim [<attempts> [<delay>]]
  363.  claims the currently selected port and initialise it, with optional retries
  364.  if the port is unavailable. Returns 1/0 for success/failure
  365.  
  366. release
  367.  releases port (also dropping line).
  368.  
  369. init [<string>]
  370.  drops and raises DTR on serial port to put modem in command mode, and sends
  371.  the specified string to the modem; then waits for "OK". Returns 1/0 for
  372.  success/failure.
  373.  If no string is given, the init strings from the modem driver are sent.
  374.  
  375. reinit
  376.  resets serial port.
  377.  
  378. retry [<attempts> [<delay>]]
  379.  sets default number of dialling retries and intervening delay, in seconds.
  380.  
  381. dial [/pulse] [/retry=<n>] [/delay=<n>] [/nodial=<n>] [/nocar=<n>]
  382.         [/busy=<n>] <number> [<number> ... ]
  383.  dials the specified number or list of numbers. If a list is given, a number
  384.  will be tried multiple times (specified by 'retry') before moving on to the
  385.  next in the list. Returns 1/0 for success/failure.
  386.  /pulse uses pulse dialling instead of tone.
  387.  /delay=<n> and /retry=<n> override the default number of retries and delay.
  388.  /nodial=<n>, /nocar=<n> and /busy=<n> override default redial delays for
  389.  individual cases (ie, no dialtone, no carrier, busy). Useful, eg, to
  390.  specify a longer delay for no dialtone (someone using phone).
  391.  
  392. send [/raw] [/noraw] [name=<id>] <string> [<string> ... ]
  393.  sends a string to the serial port or a taskwindow.
  394.  /raw           prevents a newline.
  395.  /noraw         renables newlines.
  396.  /name=<id>     sends the string to taskwindow <id> rather than the serial
  397.                 port.
  398.  
  399. ?line <condition>
  400.  tests condition of serial port lines. Condition can be one of:
  401.   /cts
  402.   /dsr
  403.   /rng
  404.   /dcd
  405.   Returns 1/0 for high/low
  406.  
  407. 4: Control
  408. ----------
  409.  
  410. wait [/delay=<n>] [/id=<id>] <string1> [<string2>...]
  411.  waits for a string to be received. You can specify up
  412.  to 4 strings to wait for. For example:
  413.  wait login password
  414.   returns 1 if "login" is detected, 2 if "password" is detected, or 0 if the
  415.   command times out.
  416.   The default timeout is 600 seconds (10 minutes); you can alter this with
  417.   the /delay=<n> qualifier. For example:
  418.   wait /delay=20 login
  419.    waits for 20 seconds for the string "login".
  420.  To include spaces in a wait string, quote the string - eg:
  421.   wait /delay=20 login "contrived example" HELLO
  422.  
  423.  The default input stream examined is the serial (or other) port, as defined
  424.   by the "port" command. If the qualifier "/id=<id>" is specified, the
  425.   output stream from the specified taskwindow is examined instead. Note that
  426.   you can at present only specify a taskwindow which is being buffered to a
  427.   window; not one with output to a file.
  428.                                   
  429. wait /event
  430.  waits for an event such as an alarm or a user menu selection.
  431.  
  432. event [/enable|/disable] <event-type> [<event-type> ... ]
  433.  enables or disables events. You might want to disable events during
  434.  sensitive script operations, such as logging in. Events will still be queued
  435.  while disabled, but will not be acted upon until an "event/enable" is issued.
  436.  Note that "stop" and "error" events cannot be disabled!
  437.  Event types are as follows:
  438.    sys    slipdial system events (cannot be disabled)
  439.    time   timed alarms
  440.    line   line alarms
  441.    task   task termination events
  442.    twin   taskwindow termination events
  443.    input  user command input (command window)
  444.    icon   click on user icons
  445.    file   file dropped on user icons
  446.    menu   user-defined menus
  447.    eof    user-file EOF events
  448.  Event specifications may be combined in one command, eg:
  449.    event /disable all /enable line menu task
  450.  
  451. alarm /time=<time> [/repeat] [/id=<id>] <action>
  452.  sets an alarm either for time-of-day or elapsed time. <time> is specified as:
  453.    HH:MM:SS     time of day
  454.   +HH:MM:SS     elapsed time
  455.  The /repeat qualifier will resubmit the same alarm setting  after it goes off.
  456.  The /id qualifier associates a name with an alarm, so it can be cancelled.
  457.  
  458. alarm /cancel=<id>
  459.  Cancels a timed alarm. (to cancel a non-timed alarm such as /stop or /dcd,
  460.  set the alarm with a null command - eg, 'alarm/stop').
  461.  
  462. alarm /stop=<command>
  463.  Specifies a command to be executed when the "Stop" button is clicked. If no
  464.  stop alarm is defined, the serial device is released and the script pauses.
  465.  This alarm cancels itself when it goes off.
  466.  
  467. alarm /dcd[=0|1] <command>
  468. alarm /cts[=0|1] <command>
  469. alarm /dtr[=0|1] <command>
  470. alarm /rng[=0|1] <command>
  471. alarm /dsr[=0|1] <command>
  472.  Specifies command to execute when the specified line becomes low (or high).
  473.  This alarm cancels itself when it goes off. Use the '=1' value specification
  474.  to trigger on low->high, otherwise, triggers on high->low.
  475.  
  476. alarm/error=<command>
  477.  defines command to execute when a script error occurs.
  478.  
  479. alarm/icon=<id> <command>
  480.  defines command to execute when a file is dropped onto icon with identifier
  481.  <id>. The name of the file dropped is put into the variable $file, and its
  482.  filetype (in hex) into $type.
  483.  
  484. menu "entry:command" ["entry:command"]...
  485.  defines a user menu (only acted upon during a "wait /event")
  486.  For example:
  487.  menu "Call Demon:call calldemon" "Send Mail:call sendmail" "Quit:quit"
  488.  
  489. menu/icon=<id> "entry:command" ["entry:command"]...
  490.  defines a menu associated with an iconbar icon (added by the 'icon'
  491.  command).
  492.  
  493. icon/id=<id> [/file=<filename>] [/action=<command>] <spritename>
  494.  adds an icon to the icon bar. Up to 5 extra icons can be added, each with
  495.  their own associated actions and menus.
  496.  /id=<id> identifies the icon (either a new icon or replacement)
  497.  /file=<filename> loads the named sprite file into slipdial's sprite pool
  498.         (note, limited space available!)
  499.  /action=<command> defines script command to execute when icon is clicked.
  500.  
  501. icon/cancel=<id> deletes an icon from the iconbar.
  502.  
  503. icon /free returns the amount of free space in the slipdial sprite area. This
  504.  can be used to check whether it is possible to load a sprite file.
  505.  
  506. pause <n>
  507. sleep <n>
  508.  Waits for <n> seconds before continuing script execution.
  509.  If <n> is zero or omitted, puts script into pause mode (restart 
  510.  by clicking on Resume).
  511.  
  512. task [/name=<name>] [/exit=<command>] [/wait] <filespec>
  513.  starts the specified task. Example:
  514.  task <TCPIP$Dir>.!Run
  515.  /name  specifies a name to be associated with the command (by which it may
  516.  be killed, for example).
  517.  /exit  specifies a command to be executed when the task terminates.
  518.  /wait  forces the script to wait for the started task to finish. Otherwise,
  519.   script execution continues as soon as the task starts (the "/exit" command,
  520.   if any, being added to the event queue when the task finishes).
  521.  It is possible to combine the "/wait" and "/exit" qualifiers, but also
  522.  pointless!
  523.  
  524. task /kill[=<taskname>]
  525.  task /kill by itself kills the last task to be started by the "task" command.
  526.  task /kill <taskname> kills a task by name (name as known by the task
  527.   manager). Only tasks known to SLIPdial (started by the "task" command) can
  528.   be killed.
  529.  
  530. taskwindow [/name=<name>] [/size=<nK>] [/exit=<command>] [/wait] [/keep]
  531.                 [/output=<filename>] "<external command>"
  532.  Starts a taskwindow process.
  533.  /name  name for task manager (default is "SDtaskn", where n is a number).
  534.  /size  sets wimpslot size for task (default is size of "Next" slot).
  535.  /exit  defines command to execute when task terminates
  536.  /output    sets file to store output in (if no file specified, all output
  537.         goes to a buffer window).
  538.  /nooutput  prevents an output window from being opened, though the data
  539.         is still buffered internally as if a window were present.
  540.  /wait  forces the script to wait for the started task to finish. Otherwise,
  541.         script execution continues as soon as the task starts (the "/exit"
  542.         command, if any, being added to the event queue when the task
  543.         finishes).
  544.  /keep  causes the buffer window, if any, to be kept onscreen after the
  545.         task finishes. Otherwise, the window is deleted as the task exits.
  546.         The slipdial taskwindow "slot" cannot be re-used until the window
  547.         is closed.
  548.  It is possible to combine the "/wait" and "/exit" qualifiers, but also
  549.  pointless!
  550.  
  551. taskwindow /kill=<id>
  552.  kills the given taskwindow.
  553.  
  554. taskwindow /suspend=<id>
  555. taskwindow /resume=<id>
  556.  these commands suspend or resume a taskwindow.
  557.  
  558. dataopen <taskname> <filespec>
  559.  sends a dataopen message for the specified file to the specified task.
  560.  
  561. ipget [/delay=<n>] <string>
  562.  waits for <string>, which should mark the start of a dynamically-assigned
  563.  IP number. The rest of the number will then be captured. Example:
  564.    ipget 134.
  565.  The string:
  566.    Your IP address is 134.84.101.42.
  567.  is received. The IP number 134.84.101.42 is captured, into the script variable  "ipaddress", for use by the "make" or other commands. The variables ip1, ip2,
  568.  ip3 amd ip4 are also set, to the four components of the IP address.
  569.  
  570.  The /delay qualifier sets the command timeout in seconds. If not specified,
  571.  a timeout of 60 seconds is assumed.
  572.  
  573. make <source> <dest>
  574.  Makes one file from another, performing variable substitutions. For example,
  575.  to create an Autoexec file for !TCPIP. Occurances of "%variable" in the
  576.  source file are replaced by the variable value in the output file. Eg:
  577.     ip address [%ipaddress]
  578.     attach asy %port slip ax0 4096 576 %speed
  579.     route add default ax0 [%ip1.%ip2.%ip3.254] 1
  580.  becomes:
  581.     ip address [134.84.101.42]
  582.     attach asy sp_dual 1 slip ax0 4096 576 57600
  583.     route add default ax0 [134.84.101.254] 1
  584.  
  585.  Specifying output file contents within scripts:
  586.  You can take lines from the script as well as from an input file. Script
  587.  lines following the "make" command which have a "+" as the first character
  588.  will be used as source lines for the output file (the + character being
  589.  stripped off). Specify an input file of "-" to use only these script lines.
  590.  If you specify both a real input file and + lines, the + lines will be used
  591.  after the input file has been processed.
  592.  
  593.  Comment lines (those beginning with a "#") in the source file are not
  594.  transferred to the output file.
  595.  
  596. list /var
  597. list /tasks
  598. list /menus
  599. list /script [<first> [<last>]]
  600. list /alarms
  601. list /files
  602.  Lists current variables, tasks, menus, script, alarms, or open userfiles
  603.  to the debug window.
  604.  
  605. ?free [/mem] [/next] [/free] [/device=<filespec>] [/int]
  606.  returns amount of free memory:
  607.  /mem   returns all free memory, ie next+free slots
  608.  /next  returns size of 'next' slot
  609.  /free  returns size of 'free' slot
  610.  /device    returns amount of space left on the device holding <filespec>
  611.  /internal  returns internal free space within slipdial application
  612.  
  613. input [/prompt=<prompt>] [/hide] <variable>
  614.    [[/prompt=<prompt2>] <variable2> ... ]]
  615.  Prompts the user for input in a window, and place the input in a script
  616.  variable. Multiple prompts/inputs can be combined in one command.
  617.  The /hide qualifier prevents the typed response from being displayed
  618.  (for example, when entering passwords).
  619.  
  620.  
  621. 5: File commands
  622. ----------------
  623.  
  624. move <file1> <file2>
  625.  moves a file from one location to another.
  626.  (a rename is tried first; if that fails, a copy with source delete is tried).
  627.  
  628. copy [/head=<n> /tail=<n>] <file1> <file2>
  629.  copies one file to another.
  630.  With either the /head or /tail qualifier, copies only the first or last <n>
  631.   lines of the file. If <n> is unspecified, a default of 50 is used.
  632.  
  633. For both move and copy, a '*' within the destination filename is replaced
  634. with a 4-digit random number such that the destination file is guaranteed
  635. unique. The created destination filename is also stored in the script
  636. variable '$dest', for later reference.
  637.  
  638. append <file1> <file1>
  639.  appends file1 to file2 (if file2 doesn't exist, it is created).
  640.  
  641. delete <file>
  642.  deletes a file.
  643.  
  644. ?file <filename>
  645.  ?file itself returns object type of file
  646.    0 doesn't exist
  647.    1 file
  648.    2 directory
  649.    3 image file
  650.  Other qualifiers available:
  651.  /size    returns the size (in bytes) of the given object.
  652.  /type    returns the (hex) filetype.
  653.  /attrib  returns the file attributes (bit 0 = read access, etc).
  654.  /expand  returns the canonicalised filename.
  655.  /leaf    returns the leafname of <filename>.
  656.  /path    returns the path component of <filename>.
  657.  
  658. trace <filename>
  659.  opens <filename> as a debugging logfile. All output which appears in the
  660.  debug window is also sent here. (currently excepting taskwindow output).
  661.  
  662. open /id=<id> [/error=<command>] [/read|/write|/rw] <filename>
  663.  Opens the named file for read, write or read-write access, associating the
  664.  given identifier with the file.
  665.  The /error qualifier defines a command to execute if the file open fails.
  666.  
  667. close /id=<id>
  668.  Closes the file with the given identifier.
  669.  
  670. read /id=<id> [/eof=<command>] <variable> [<variable> ... ]
  671.  Reads lines from the given file into script variables.
  672.  The /eof qualifier defines a command to execute if end-of-file
  673.   is reached during the read oeration.
  674.  
  675. write /id=<id> <data> [<data> ... ]
  676.  Writes textual data into the given file.
  677.  
  678. ptr /id=<id> [/set=<n>] [<variable>]
  679.  Reads or sets the pointer into the named file.
  680.  Without the "/set" qualifier, returns the file pointer (optionally setting
  681.  the named variable).
  682.  With the /set qualifier, sets the file pointer.
  683.  "/set=eof" sets the pointer to end-of-file.
  684.  
  685.  
  686. 6: Script Variables
  687. -------------------
  688.  
  689. Variable substitution takes place on each line in the script during
  690. execution. A variable is specified by the prefix "%"; for example:
  691.  set lemming goto start
  692.  %lemming
  693. would execute the command "goto start".
  694.  
  695. Some variables are defined automatically during script execution. These are:
  696.  
  697. $status
  698.  contains values returned from script commands, often indicating success
  699.  or failure, but can indicate more detailed results.
  700.  
  701. port
  702.  contains driver and port in use (set by "port" command)
  703.  
  704. speed
  705.  contains baud rate (set by "speed" command)
  706.  
  707. ipaddress
  708.  contains IP address detected by "ipget" command. Setting this variable causes
  709.  automatic recalculation of the variables ip1,ip2,ip3,ip4, and updates the
  710.  "IP" address field in the status window.
  711.  
  712. ip1,ip2,ip3,ip4
  713.  contain the four components of a detected IP address.
  714.  
  715. route
  716.  set to %ip1.%ip2.%ip3.254 by "ipget", but you can of course alter it
  717.  yourself.
  718.  
  719. p1 p2 p3 (etc)
  720.  parameters passed to a subroutine. Note these are NOT preserved throughout
  721.  the execution of the subroutine and will be destroyed by further calls to
  722.  other routines. Transfer values to variables of your own if you want to
  723.  keep them for later use.
  724.  
  725. 7: Notes
  726. --------
  727.  
  728. Alarm scheduling is done using OS_ReadMonotonicTime. Things may (certainly
  729. will!) break when the timer wraps around to a negative value. Will possibly
  730. be fixed someday, but not terribly likely!
  731.  
  732. Some functions operate in slightly unexpected ways. The correct way to use
  733. the "message/capture" command is not obvious, for example. It does not, in
  734. fact, examine the serial input stream itself at all; but merely installs a
  735. "filter". For text to be captured, you then need to use a command which does
  736. examine the input stream - examples being "wait", "ipget", etc.
  737. To avoid flicker, the message window is not updated on every captured line.
  738. Instead, it gets refreshed whenever a blank line is received. A four-second
  739. timer also causes a refresh if the contents change but the window is not
  740. updated for that long.
  741. An update can be forced by adding a blank line to the window: "message/add".
  742. Blank lines are not added to the display list; they simply cause a refresh.
  743.  
  744. "task/exit" and "taskwindow/exit" also need some explanation. These commands
  745. enable another script command to be executed when the started task finishes.
  746. How this operates is to add the "exit command" to the event queue when task
  747. termination is detected. After the "task/exit" command, script execution
  748. continues immediately after the task starts; the exit command, therefore,
  749. can be triggered at any future point in the script. For most simple
  750. commands, or even most subroutine calls, this presents no problem, but
  751. obviously "goto" commands and suchlike should probably be avoided. For
  752. particulary critical routines, where the execution of a lengthy
  753. event-command could disrupt things - for example, during a login sequence -
  754. event processing can be disabled, using the "event/disable[=<type>]"
  755. command.
  756.  
  757. The script can stay in the dialling routine for a relatively long time.
  758. During this time, events (alarms, menus, etc) are not acted upon. The
  759. pause, stop, and redial buttons are active in the status window.
  760.  
  761. Currently hard-coded limits are:
  762. Script line limit               2000 (but memory management may not
  763.                                 cope with a script this size, at present!)
  764. Items per user menu             30 (255 character limit total for each
  765.                                     of description & command lists)
  766. Timed alarms                    10
  767. Simultaneous tasks              8       ('task' command)
  768. Simultaneous taskwindows        8       ('taskwindow' clients)
  769. Variables                       150
  770. Goto/call destinations          50
  771. Subroutine levels               20
  772. Case...when...endcase levels    10
  773. Simultaneous 'wait' strings     4
  774. Pending events                  10
  775. Open "user" files               10
  776. User icons                      8
  777.  
  778. ----------------------------------------------------------------------------
  779. Disclaimer!
  780. -----------
  781.  
  782. SLIPdial is probably still full of bugs. Most things seem to work okay, but
  783. the increasing complexity of the script language, plus the fact that the
  784. program was simply cobbled together over time, makes exhaustive checking
  785. difficult. However, I would like to thank several people for testing
  786. slipdial during the rapidly-changing versions between 0.23 and 0.30:-
  787.  
  788. Robert Orwin    rob@wong.demon.co.uk
  789. Ian Stocks      ian@frogstar.demon.co.uk
  790. Andrew Black    andrew@bach.demon.co.uk
  791. Paul Allen      pla@sktb.demon.co.uk
  792. Rick Hewitt     rick@chocky.demon.co.uk
  793. also many others who pointed out bugs or made suggestions.
  794.  
  795. Any problems, suggestions or questions can be sent to me via email at:
  796.  
  797. allan@mnhep1.hep.umn.edu
  798.